package com.mars.module.admin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.mars.module.system.entity.BaseEntity;

import java.time.LocalDateTime;

/**
 * 文章对象 sys_article
 *
 * @author mars
 * @date 2024-03-18
 */
@Data
@ApiModel(value = "文章对象")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sys_article")
public class SysArticle {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "id")
    private Long id;
    /**
     * 标题
     */
    @Excel(name = "标题")
    @ApiModelProperty(value = "标题")
    private String title;
    /**
     * 内容
     */
    @Excel(name = "内容")
    @ApiModelProperty(value = "内容")
    private String content;
    /**
     * 作者
     */
    @Excel(name = "作者")
    @ApiModelProperty(value = "作者")
    private String author;
    /**
     * 文章分类ID
     */
    @Excel(name = "文章分类ID")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @ApiModelProperty(value = "文章分类ID")
    private String categoryId;
    /**
     * 状态
     */
    @Excel(name = "状态")
    @ApiModelProperty(value = "状态")
    private String status;
    /**
     * 图片
     */
    @Excel(name = "图片")
    @ApiModelProperty(value = "图片")
    private String picture;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "创建人ID")
    private Long createById;

    @TableField(exist = false)
    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @TableField(exist = false)
    @ApiModelProperty(value = "当前登录人是否点赞")
    private String isLike;

    @TableField(exist = false)
    @ApiModelProperty(value = "当前登录人是否收藏")
    private String isCollect;

    @TableField(exist = false)
    @ApiModelProperty(value = "创建人")
    private String createUser;
}
